from django.contrib import admin
from django.urls import path, include, re_path
from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView, TokenVerifyView

from . import views

urlpatterns = [
    # 登录认证-post
    path('jwt/access/', TokenObtainPairView.as_view()),
    # 刷新认证-post
    path('jwt/refresh/', TokenRefreshView.as_view()),
    # 校验认证-post
    path('jwt/verify/', TokenVerifyView.as_view()),
    # 自定义登录方法
    path('login/', views.LoginView.as_view()),
    # 验证手机号
    re_path(r"^mobile/(?P<mobile>1[3-9]\d{9})/$", views.MobileAPIView.as_view()),
    # 发送验证码
    re_path(r"^sendsms/(?P<mobile>1[3-9]\d{9})/$", views.SendSmsAPIView.as_view()),
    # 注册账号
    path('register/', views.RegisterView.as_view()),
]